﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Threading.Tasks;

namespace NBBL_Tile_Editor
{
    public enum EntityType
    {
        ENTITY_BASE = 0, PLAYER_RED, PLAYER_BLUE,
        ENEMY_GORBACHEV, ENEMY_CANNYBLE, WALL_INVINCIBLE, WALL_TALL, WALL_SHORT,
        PUP, BALL
    };


    public class Entity
    {
        //Entity Location
        int x = 0;

        public int X
        {
            get { return x; }
            set { x = value; }
        }

        int y = 0;

        public int Y
        {
            get { return y; }
            set { y = value; }
        }

        EntityType type = 0;

        public EntityType Type
        {
            get { return type; }
            set { type = value; }
        }

        public Entity(int x, int y, int entityType)
        {
            this.x = x;
            this.y = y;
            Type = (EntityType)entityType;
        }

        public Entity(int x, int y, EntityType entityType)
        {
            this.x = x;
            this.y = y;
            Type = entityType;
        }

        public override string ToString()
        {
            //Return a string based on type
            if (type == EntityType.PLAYER_RED)
                return "Red Player";
            else if (type == EntityType.PLAYER_BLUE)
                return "Blue Player";
            else if (type == EntityType.BALL)
                return "Ball";
            else if (type == EntityType.ENEMY_CANNYBLE)
                return "Enemy";
            else if (type == EntityType.ENEMY_GORBACHEV)
                return "Boss";
            else if (type == EntityType.PUP)
                return "Power-Up";
            else if (type == EntityType.WALL_INVINCIBLE)
                return "Invincible Wall";
            else if (type == EntityType.WALL_TALL)
                return "Tall Wall";
            else if (type == EntityType.WALL_SHORT)
                return "Short Wall";
            else
                return "Entity";
        }

    }

    public class EnemySpawn : Entity
    {
        public EnemySpawn(int x, int y, EntityType entityType)
            : base(x, y, entityType)
        {
        }

        public void ConvertToEnemy(Entity parent)
        {
            X = parent.X;
            Y = parent.Y;
            Type = parent.Type;
        }

        int stamina = 50;
        public int Stamina
        {
            get { return stamina; }
            set { stamina = value; }
        }
        int speed = 3;

        public int Speed
        {
            get { return speed; }
            set { speed = value; }
        }
        int strength = 3;

        public int Strength
        {
            get { return strength; }
            set { strength = value; }
        }
        int dexterity = 3;

        public int Dexterity
        {
            get { return dexterity; }
            set { dexterity = value; }
        }
        int endurance = 3;

        public int Endurance
        {
            get { return endurance; }
            set { endurance = value; }
        }
        float regenRate = 3;

        public float RegenRate
        {
            get { return regenRate; }
            set { regenRate = value; }
        }

        List<Point> waypoints = new List<Point>();

        public List<Point> Waypoints
        {
            get { return waypoints; }
            set { waypoints = value; }
        }

        EnemySpawn(int x, int y, int type)
            : base(x, y, type)
        {
            if (Type == EntityType.ENEMY_GORBACHEV)
            {
                Stamina = 100;
                Speed = 5;
                Strength = 5;
                Dexterity = 5;
                Endurance = 5;
                RegenRate = 10.0f;
            }
        }
    }

}
